package com.wf.classRoomTest;

import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;

/**
 * @author mpk
 * @since 2024/6/3 16:18:53
 */
public class TreeMapTest {
    public static void main(String[] args) {
        TreeMap<Integer, Integer> iT = new TreeMap<>(Comparator.comparingInt(Integer::intValue).reversed());

        iT.put(8, 1);
        iT.put(4, 1);
        iT.put(45, 1);
        iT.put(34, 1);
        iT.put(43, 1);
        for (Map.Entry<Integer, Integer> integerIntegerEntry : iT.entrySet()) {

            System.out.println(integerIntegerEntry.getKey()+" "+integerIntegerEntry.getValue());
        }

    }


}
